package scu.maqiang.eigenvalue;

import scu.maqiang.mesh.Mesh3T4;
import scu.maqiang.mesh.ScalarFunc;

public class ThreeScaleSteklovFine3D {

	public static void main(String[] args) {
		String dir = "SteklovEigenValue\\";
		Mesh3T4 mesh3D = new Mesh3T4().cube(288, 288, 288);
		//mesh3D.displayNodes();
		//mesh3D.displayElements();
		//mesh3D.displayBoundarys();
		int n = 6;
		double eps = 1.0/n;
		double[] param = new double[] {4.0};
		ScalarFunc chFun = (xy, label, para) -> {
			double nn = para[0];
			double xCell = xy[0] * nn - (int)(xy[0] * nn);
			double yCell = xy[1] * nn - (int)(xy[1] * nn);
			double zCell = xy[2] * nn - (int)(xy[2] * nn);
			return (Math.abs(xCell- 0.5) < 1.0/6 && Math.abs(yCell - 0.5) < 1.0/6 && Math.abs(zCell - 0.5) < 1.0/6)? 1.0:-1.0;	
		};
		mesh3D.removeElements(chFun, param, 8);
		param[0] = 24.0;
		mesh3D.removeElements(chFun, param, 8);
		mesh3D.toTecplot(dir + "ThreeScaleStructure.dat");
	}

}
